/**
 * 获得所有rowkey
 * @returns {String}
 */
function getRowkeys() {
	var rowkeys = "";
	var tbid = $("#htableselect").find("option:selected").val();
	$.ajax({
		url : "/smarttest-frontstage/dataprovider/getHbasekeys.action",
		data : {tbid:tbid},
		method : 'GET',
		async:false,
		error:function(response,error){
			dialog('error','error'+response.status,3000);
			}, 
		success : function(data) {
			rowkeys = data.data;
		}
	});
	return rowkeys;
}
/**
 * 获得所有htable
 * @returns {Number}
 */
function getTables(){
	var code;
	var hbaseid = $("#hbaseselect").find("option:selected").val();
	$.ajax({
		url : "/smarttest-frontstage/dataprovider/getHbaseTables.action",
		data : {hbaseid:hbaseid},
		method : 'GET',
		async:false,
		error:function(response,error){
			dialog('error','error'+response.status,3000);
			code = -1;
			}, 
		success : function(data) {
			$("#htableselect").html(data.data);
			code = 0;
		}
	});
	return code;
}
/**
 * 获得所有hbase
 * @returns {Number}
 */
function getHbases() {
	var code;
	$.ajax({
		url : "/smarttest-frontstage/dataprovider/getHbases.action",
		method : 'GET',
		async:false,
		error:function(response,error){
			dialog('error','error'+response.status,3000);
			code = -1;
			}, 
		success : function(data) {
			$("#hbaseselect").html(data.data);
			code = 0;
		}
	});
	return code;
}
/**
 * 获得hbase的连接配置
 * @param ele
 * @returns {Number}
 */
function getHbasePro(ele) {
	var hid = ele.find("option:selected").val();
	var code;
	$.ajax({
		url : "/smarttest-frontstage/dataprovider/getHbasePro.action",
		method : 'GET',
		data : {hbaseid:hid},
		async:false,
		error:function(response,error){
			dialog('error','error'+response.status,3000);
			code = -1;
			}, 
		success : function(data) {
			$("#hbaseproperties").html(data.data);
			code = 0;
		}
	});
	return code;
}
/**
 * 获得rowkey 所有规则配置并生成html
 * @returns {String}
 */
function getrowkeysearchstr() {
	var rowkeystr = "";
	var tbid = $("#htableselect").find("option:selected").val();
	$.ajax({
		url : "/smarttest-frontstage/dataprovider/getRowkeySearchStr.action",
		data : {tbid:tbid},
		method : 'GET',
		async:false,
		error:function(response,error){
			dialog('error','error'+response.status,3000);
			}, 
		success : function(data) {
			rowkeystr = data.data;
		}
	});
	return rowkeystr;
}
